package es.gesfutbol.dao;

import org.hibernate.criterion.Restrictions;
import org.springframework.transaction.annotation.Transactional;

import es.gesfutbol.domini.implementacio.Forum;
import es.gesfutbol.util.HibernateDao;

public class ForumDao extends HibernateDao<Forum, Long> implements IForumDao{

	@Override
	@Transactional(readOnly = true)
	public Forum findByIdPenya(Long idPenya) {
		return (Forum) this.getSessionFactory().getCurrentSession().createCriteria(Forum.class)
				.add(Restrictions.eq("penya.idPenya", idPenya)).uniqueResult();
	}

}
